<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;


/**
 * App\Models\Wallet
 *
 * @property int $id
 * @property int $uid 会员ID
 * @property float $balance 账户余额
 * @property float $total_income 累计收入
 * @property float $total_cost 累计支出
 * @property int $integral
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereBalance($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereIntegral($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereTotalCost($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereTotalIncome($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Wallet whereUid($value)
 * @mixin \Eloquent
 */
class Wallet extends Model
{
    protected $table = 'wallet';
    protected $primaryKey = 'id';
    protected $guarded = [];

    public $timestamps = false;

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class, 'uid', 'uid');
    }
}
